package com.pipayshop.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pipayshop.domain.ShopCommodityEvaluate;
import com.pipayshop.domain.dto.ShopCommodityEvaluateAddDto;
import com.pipayshop.domain.vo.EvaluateVO;
import com.pipayshop.domain.vo.ShopCommodityEvaluateVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author xiaoqiu
 * @date 2024/9/23 10:29
 * @description
 */
@Mapper
public interface OnlineStoreShopCommodityEvaluateMapper extends BaseMapper<ShopCommodityEvaluate> {
    List<ShopCommodityEvaluateVO> getItemCommodityEvaluates(@Param("commodityId") String commodityId, @Param("page") int page, @Param("limit") Integer limit);

    Long getShopCommodityEvaluatesSum(String commodityId);

    int insertItemCommodityEvaluateAddVO(@Param("evaluateId") String evaluateId, @Param("shopCommodityEvaluateAddDto") ShopCommodityEvaluateAddDto shopCommodityEvaluateAddDto);

    List<EvaluateVO> getShopCommodityEvaluate(@Param("shopId") String shopId, @Param("offset") Integer offset, @Param("limit") Integer limit);

    @Select("select count(*) from shop_commodity_evaluate where shop_id=#{shopId} and status=0")
    Long getInfoSize(String shopId);
}
